import pytest,os,yagmail,logging

class Tools():
    def log(self):
        aa = logging.basicConfig(level=logging.INFO,
                                 filename='rizhi.log',
                                 filemode='w+',
                                 format='%(levelname)s%(filename)s%(message)s%(lineno)d')
        return aa
    def Baiogao(self):
        pytest.main(['-s','/ShoppingCenter/Case_01.py','--clean-alluredir','--alluredir=./Baogao'])
        os.system('allure generate ./Baogao -o ./html -- clean')

    def Email(self):
        aa = yagmail.SMTP(user='3153075207@qq.com',password='qhgbeikriqgjdcei',host='smtp.qq.com')
        aa.send(to='3153075207@qq.com',subject='邮件',contents='发送报告',attachments=['rizhi.log'])
        aa.close()






























